$(function () {
    $("#datetimestart").datetimepicker({
        format: 'yyyy-mm-dd hh:ii',
        autoclose: true,
        language: "zh-CN",
        weekStart: 1,
        todayBtn: 1,
        todayHighlight: 1,
        startView: 2,
        minView: 0,
        minuteStep: 1,
        forceParse: 0,
        pickerPosition: "bottom-left",
        clearBtn: true,
    }).on("changeDate", function (ev) {  //值改变事件
        //选择的日期不能大于第二个日期控件的日期
        if (ev.date) {
            $("#datetimeend").datetimepicker("setStartDate", new Date(ev.date.valueOf()));
        } else {
            $("#datetimeend").datetimepicker("setStartDate", null);
        }
    });
    $("#datetimeend").datetimepicker({
        format: 'yyyy-mm-dd hh:ii',
        autoclose: true,
        language: "zh-CN",
        weekStart: 1,
        todayBtn: 1,
        todayHighlight: 1,
        startView: 2,
        minView: 0,
        minuteStep: 1,
        forceParse: 0,
        pickerPosition: "bottom-left",
        clearBtn: true,
    }).on("changeDate", function (ev) {  //值改变事件
        //选择的日期不能大于第二个日期控件的日期
        if (ev.date) {
            $("#datetimestart").datetimepicker("setEndDate", new Date(ev.date.valueOf()));
        } else {
            $("#datetimestart").datetimepicker("setEndDate", null);
        }
    });
})